<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="mytag" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<fmt:setBundle basename="ua.races.raceBundle"/>

<c:set var="titleText"><fmt:message key="bookmaker.setCoefs.title"/></c:set>
<html>
<head>
    <title>${titleText}</title>
</head>
<body>
<c:set var="logoutText"><fmt:message key="logout"/></c:set>
<mytag:logout text="${logoutText}"/>

<mytag:stat history="5" align="center"/>

<c:set var="dateText"><fmt:message key="races.date"/></c:set>
<c:set var="submitText"><fmt:message key="bookmaker.setCoefs.submit"/></c:set>
<c:set var="coefText"><fmt:message key="bookmaker.setCoefs.coefficient"/></c:set>
<c:set var="horseNameText"><fmt:message key="bookmaker.horse.name"/></c:set>
<c:set var="timeText"><fmt:message key="races.startTime"/></c:set>
<c:set var="actionText"><fmt:message key="races.action"/></c:set>
<c:set var="stadiumText"><fmt:message key="races.stadium"/></c:set>

<jsp:useBean id="race" type="ua.races.vo.Race" scope="request"/>
<table align="center" summary="" border="1" bgcolor="#fff0f5">
    <tr>
        <td>${dateText}</td>
        <td><c:out value="${race.raceDate}"/></td>
    </tr>
    <tr>
        <td>${timeText}</td>
        <td><c:out value="${race.startTime}"/></td>
    </tr>
    <tr>
        <td>${stadiumText}</td>
        <td><c:out value="${race.stadium}"/></td>
    </tr>
</table>

<jsp:useBean id="horses" type="java.util.List" scope="request"/>
<table align="center" summary="" border="1" bgcolor="#fff0f5">
    <thead bgcolor="#faebd7">
    <tr>
        <th>${horseNameText}</th>
        <th>${coefText}</th>
    </tr>
    </thead>
    <tbody>
    <form action="postCoefs.do" method="POST">
        <input type="hidden" name="raceId" value="${race.raceId}">
        <c:forEach var="horse" items="${horses}">
            <tr>
                <td><input type="hidden" name="horseId" value="${horse.horseId}"><c:out value="${horse.horseName}"/></td>
                <td><input type="text" name="coef"/></td>
            </tr>
        </c:forEach>
        <td></td>
        <td><input type="submit" value="${submitText}"/></td>
    </form>
    </tbody>
</table>


</body>
</html>